home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / pangomm-1.4 / pangomm / coverage.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-20  |  4.5 KB  |  170 lines

  1. // -*- c++ -*-
  2. // Generated by gtkmmproc -- DO NOT MODIFY!
  3. #ifndef _PANGOMM_COVERAGE_H
  4. #define _PANGOMM_COVERAGE_H
  5.  
  6. #include <glibmm.h>
  7.  
  8. /* $Id: coverage.hg,v 1.1.1.1 2003/01/21 13:41:03 murrayc Exp $ */
  9.  
  10. /* coverage.h
  11.  *
  12.  * Copyright (C) 1998-1999 The gtkmm Development Team
  13.  *
  14.  * This library is free software; you can redistribute it and/or
  15.  * modify it under the terms of the GNU Library General Public
  16.  * License as published by the Free Software Foundation; either
  17.  * version 2 of the License, or (at your option) any later version.
  18.  *
  19.  * This library is distributed in the hope that it will be useful,
  20.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  22.  * Library General Public License for more details.
  23.  *
  24.  * You should have received a copy of the GNU Library General Public
  25.  * License along with this library; if not, write to the Free
  26.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  27.  */
  28.  
  29. #include <glibmm/arrayhandle.h>
  30. #include <pango/pango-font.h>
  31.  
  32.  
  33. namespace Pango
  34. {
  35.  
  36.  
  37. /** @addtogroup pangommEnums Enums and Flags */
  38.  
  39. /**
  40.  * @ingroup pangommEnums
  41.  */
  42. enum CoverageLevel
  43. {
  44.   COVERAGE_NONE,
  45.   COVERAGE_FALLBACK,
  46.   COVERAGE_APPROXIMATE,
  47.   COVERAGE_EXACT
  48. };
  49.  
  50. } // namespace Pango
  51.  
  52.  
  53. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  54. namespace Glib
  55. {
  56.  
  57. template <>
  58. class Value<Pango::CoverageLevel> : public Glib::Value_Enum<Pango::CoverageLevel>
  59. {
  60. public:
  61.   static GType value_type() G_GNUC_CONST;
  62. };
  63.  
  64. } // namespace Glib
  65. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  66.  
  67.  
  68. namespace Pango
  69. {
  70.  
  71.  
  72. /** A Pango::Coverage represents a map from ISO-10646 character point to Pango::CoverageLevel.
  73.  * It is often necessary in pango to determine if a particular font can represent a particular character,
  74.  * and also how well it can represent that character. Pango::Coverage holds this information.
  75.  */
  76. class Coverage
  77. {
  78.   public:
  79. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  80.   typedef Coverage CppObjectType;
  81.   typedef PangoCoverage BaseObjectType;
  82. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  83.  
  84.   static Glib::RefPtr<Coverage> create();
  85.  
  86.   // For use with Glib::RefPtr<> only.
  87.   void reference()   const;
  88.   void unreference() const;
  89.  
  90.   ///Provides access to the underlying C instance.
  91.   PangoCoverage*       gobj();
  92.  
  93.   ///Provides access to the underlying C instance.
  94.   const PangoCoverage* gobj() const;
  95.  
  96.   ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
  97.   PangoCoverage* gobj_copy() const;
  98.  
  99. protected:
  100.   // Do not derive this.  Pango::Coverage can neither be constructed nor deleted.
  101.   Coverage();
  102.   void operator delete(void*, size_t);
  103.  
  104. private:
  105.   // noncopyable
  106.   Coverage(const Coverage&);
  107.   Coverage& operator=(const Coverage&);
  108.  
  109.  
  110.    //pango ref doc: "This function may now be unecessary since we refcount the structure. Mail otaylor redhat.com if you use it."
  111.   
  112.  
  113. public:
  114.   
  115.   /** Convert data generated from pango_converage_to_bytes() back
  116.    * to a Pango::Coverage
  117.    * @param bytes Binary data representing a Pango::Coverage.
  118.    * @param n_bytes The size of @a bytes  in bytes.
  119.    * @return A newly allocated Pango::Coverage, or <tt>0</tt> if
  120.    * the data was invalid.
  121.    */
  122.   static Glib::RefPtr<Coverage> create(const guchar* bytes, int n_bytes);
  123.  
  124.   //_WRAP_METHOD(Glib::RefPtr<Coverage> copy() const, pango_coverage_copy) //see above
  125.  
  126.   
  127.   /** Determine whether a particular index is covered by @a coverage 
  128.    * @param index The index to check.
  129.    */
  130.   CoverageLevel get(int index) const;
  131.   
  132.   /** Modify a particular index within @a coverage 
  133.    * @param index The index to modify.
  134.    * @param level The new level for @a index .
  135.    */
  136.   void set(int index, CoverageLevel level);
  137.   
  138.   /** Set the coverage for each index in @a coverage  to be the max (better)
  139.    * value of the current coverage for the index and the coverage for
  140.    * the corresponding index in @a other .
  141.    * @param other Another Pango::Coverage.
  142.    */
  143.   void max(const Glib::RefPtr<Coverage>& other) const;
  144.  
  145.   /** Convert the coverage map into a flat binary format.
  146.    * @return An array of bytes representing the coverage map.
  147.    */
  148.   Glib::ArrayHandle<unsigned char> to_bytes() const;
  149.  
  150.  
  151. };
  152.  
  153. } // namespace Pango
  154.  
  155.  
  156. namespace Glib
  157. {
  158.  
  159.   /** @relates Pango::Coverage
  160.    * @param object The C instance
  161.    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
  162.    * @result A C++ instance that wraps this C instance.
  163.    */
  164.   Glib::RefPtr<Pango::Coverage> wrap(PangoCoverage* object, bool take_copy = false);
  165.  
  166. } // namespace Glib
  167.  
  168. #endif /* _PANGOMM_COVERAGE_H */
  169.  
  170.